<!DOCTYPE html>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>单次票查询</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<jsp:include page="/common/commonCss.jsp"/>
	<jsp:include page="/common/commonJs.jsp"/>
	<script src="${basePath}commonJs/jquery.imageScroller.js"></script>
	<script src="${basePath }resources/membership/finger.js"></script>
	<script type="text/javascript">
	
		$(function() {
			$("#listBox").imageScroller({
				next : "btnNext",
				prev : "btnPrev",
				frame : "list",
				child : "li",
				auto : false
			});
		});

		// 根据会员姓名或监护人号码查询
		function queryMember(obj) {
			$("#nameOrTel").val(obj.value);
			if (obj.value == "") {
				alertError(getMessage($common_msg_empty, "查询条件"));
				return false;
			}
			$('#container').show();
			$.ajax({
				cache : false,
				type : "post",
				dataType : "json",
				url : "${basePath}membership/single/queryMember.shtml",
				data :$("#conditionForm").serialize(),
				error : function(XMLHttpRequest) {
					ajaxError(XMLHttpRequest);
				},
				success : function(data) {//data为返回的数据，在这里做数据绑定
					if (data == null || data.length == 0) {
						$("#list li").remove();
						alertInfo("没有匹配的记录！");
					} else {
						$("#list li").remove();
						trimJsonArray(data);
						var li;
						for (var i = 0; i < data.length; i++) {
							var member = data[i];
							li = '<li>';
							if (member.isBlack == 1) {
								li += '	<a href="javascript:alertInfo(\'黑名单用户不可以操作！\') " >';
							} else {
								li += '	<a href="${basePath}membership/single/queryMemberDetail.shtml?cpnId=${cpnId}&cpnAmount=${cpnAmount}&fkBdymemId=${fkBdymemId}&memberId='
										+ member.pkMemId + ' " >';
							}
							li += '		<p class="coll_img' + (member.isBlack == 1 ? ' colle_img_red' : '') + '"><img width="102" height="136" src="${basePath}common/showImage.shtml?imagePath='
									+ member.imagePath + ' "></p>';
							li += ' 		<dl class="collection_t_l_dl">';
							if (member.memName.length > 4) {
								member.memName = '<span title=" ' + member.memName + ' ">' + member.memName.substring(0, 4) + '...</span>';
							}
							li += ' 		<dd>' + member.memName + '  ' + member.age + '岁 '  + (member.isVip == 1 ? '<a  style="color:red">VIP</a>' : ' ')  + '</dd>';
							if (member.memType == 1) {
								li += ' 		<dd class="f11">会员 <span class="f9">'
										+ member.pkMemId
										+ '</span></dd>';
								li += ' 		<dd>' + member.memberCardName
										+ '</dd>';
							} else if (member.memType == 2) {
								li += ' 		<dd class="f11">非会员</dd>';
								li += ' 		<dd></dd>';
							} else if (member.memType == 3) {
								li += ' 		<dd class="f11">访客</dd>';
								li += ' 		<dd></dd>';
							}
							li += ' 		</dl>';
							li += '	</a>';
							li += '</li>';
							$("#list").append(li);
						}
					}
					return;
				}
			});
		}
		
		function  collectFingerprint() {
			try {
				var data = collectFingerFeatrue();
				if (data != "") {
					queryMemberByFingerprint(data);
				}
			} catch (e) {
				return "";
			}
		}

		// 根据指纹查询
		function queryMemberByFingerprint(fingerprint) {
			if (fingerprint == "") {
				alertError(getMessage($common_msg_empty, "指纹采集失败，请重新录入指纹"));
				return false;
			}
			$("#fingerprint").val(fingerprint);
			$('#container').show();
			$.ajax({
				cache : false,
				type : "post",
				dataType : "json",
				url : "${basePath}membership/single/queryMemberByFingerprint.shtml",
				data :$("#fpForm").serialize(),
				error : function(XMLHttpRequest) {
					ajaxError(XMLHttpRequest);
				},
				success : function(data) {//data为返回的数据，在这里做数据绑定
					if (data == null) {
						$("#list li").remove();
						alertInfo("没有匹配的记录！");
					} else {
						$("#list li").remove();
						trimJson(data);
						var li;
						li = '<li>';
						li += '	<a href="${basePath}membership/single/queryMemberDetail.shtml?cpnId=${cpnId}&cpnAmount=${cpnAmount}&fkBdymemId=${fkBdymemId}&memberId='
								+ data.pkMemId + ' " >';
						li += '		<p class="coll_img"><img width="102" height="136" src="${basePath}common/showImage.shtml?imagePath='
								+ data.imagePath + ' "></p>';
						li += ' 		<dl class="collection_t_l_dl">';
						li += ' 		<dd>'
								+ data.memName + '  ' + data.age + '岁 ' 
								+ (data.isVip == 1 ? '<i class="vip_icon ml10"></i>' : ' ') 
								+ '</dd>';
						if (data.memType == 1) {
							li += ' 		<dd class="f11">会员 <span class="f9">'
									+ data.pkMemId
									+ '</span></dd>';
							li += ' 		<dd>' + data.memberCardName
									+ '</dd>';
						} else if (data.memType == 2) {
							li += ' 		<dd class="f11">非会员</dd>';
							li += ' 		<dd></dd>';
						} else if (data.memType == 3) {
							li += ' 		<dd class="f11">访客</dd>';
							li += ' 		<dd></dd>';
						}
						li += ' 		</dl>';
						li += '	</a>';
						li += '</li>';
						$("#list").append(li);
					}
					$('#container').show();
					return;
				}
			});
		}
	</script>
</head>
<body class="bg">


<style>
#btnPrev, #btnNext, #listBox
        {
            float: left;
        }
        
        #btnPrev, #btnNext
        {
            width: 30px;
            height: 18px;
            line-height: 18px;
            padding: 41px 0;
            text-align: center;
        }
#listBox
{
            width: 700px;
            height: 276px;
            overflow: hidden;
        }
        
#container
        {
            width: 800px;
            height: 276px;
            position: absolute;

        }
</style>

<div class="content m_auto ">
	<div class="content_l mt10">
    	<ul>
    	<shiro:hasPermission name="membership/single/jumpSingleTicket.shtml">
        	<li class="content_hover"><a href="${basePath }membership/single/jumpSingleTicket.shtml"><i class="nav_icon_a"></i><br>单次票</a></li>
		</shiro:hasPermission>
		<shiro:hasPermission name="membership/member/jumpMember.shtml">
			<li><a href="${basePath }membership/member/jumpMember.shtml"><i class="nav_icon_b"></i><br>会籍</a></li>
		</shiro:hasPermission>
		<shiro:hasPermission name="membership/visitor/jumpVisitor.shtml">
			<li><a href="${basePath }membership/visitor/jumpVisitor.shtml"><i class="nav_icon_d"></i><br>访客</a></li>
		</shiro:hasPermission>
		<shiro:hasPermission name="parreserve/loadParReserve.shtml">
			<li><a href="${basePath }parreserve/loadParReserve.shtml"><i class="nav_icon_g"></i><br>派对/团体预约</a></li>
        </shiro:hasPermission>
        </ul>
    </div>
    <div class="content_r mt10">
    	<div class="collection_h1 fixed">
        	<ul class="order">
            	<li class="order_a"><i class="order_icon">1</i>信息采集</li>
                <li class="order_b"><i class="order_icon_hui">2</i>下单</li>
            </ul>
        </div>
        <div class="payment_l mt30 tc">
        <!--membership.html-->
        	<input type="button" value="新建" class="btn" onClick="javascript:window.location.href='${basePath}membership/single/queryMemberDetail.shtml?cpnId=${cpnId}&cpnAmount=${cpnAmount}&fkBdymemId=${fkBdymemId}&memberId='">
        </div>
        <div class="payment_r mt30">
        	<div style="display:none;">
			<object classid="clsid:82C2415C-1EC7-41ED-A6F0-2BCA3B4216E2" id="finger" codebase="${basePath }plugin/Ferly727.ocx">
			  <param name="_ExtentX" value="635">
			  <param name="_ExtentY" value="582">
			  <param name="_StockProps" value="64">
			  <param name="Enabled" value="1">
			</object>
		</div>
        	<input type="hidden" id="cpnId" name="cpnId" value="${cpnId }">
        	<input type="hidden" id="cpnAmount" name="cpnAmount" value="${cpnAmount }">
		<input type="hidden" name="fkBdymemId" value="${fkBdymemId }">
        	<div class="ml60 payment_tab">
                <ul id="tab_a" class="f14 fixed">
                   <li onClick="javascript:$('#container').hide();">扫描指纹查询</li>
                   <li onClick="javascript:$('#container').hide();">条件查询</li>
                </ul>
                <ul id="tab_conbox_a">
                    <li class="tc p20">
                    	<form id="fpForm" method="post">
                    	<a href="#" onClick="collectFingerprint();">
                    		<img src="${basePath}commonCss/images/zhiwen.gif">
                    		<input type="hidden" name="fingerprint" id="fingerprint">
		        	<input type="hidden" name="cpnId" value="${cpnId }">
		        	<input type="hidden" name="cpnAmount" value="${cpnAmount }">
		        	<input type="hidden" name="fkBdymemId" value="${fkBdymemId }">
                    	</a>
                    	</form>
                    </li>
                    <li class="tc p20">
                    		姓名/电话：<input type="text" class="iput_t mt20"  onkeydown="if(event.keyCode==13) {queryMember(this);}">
                    	<form id="conditionForm" method="post">
		        	<input type="hidden" name="nameOrTel" id="nameOrTel">
		        	<input type="hidden" name="cpnId" value="${cpnId }">
		        	<input type="hidden" name="cpnAmount" value="${cpnAmount }">
		        	<input type="hidden" name="fkBdymemId" value="${fkBdymemId }">
                    	</form>
                    </li>
                </ul>
            </div>
            <div id="container" class="collection_b ml50 fixed w800 border_top" style="display:none;">
            	<div id="btnNext"><a href="javascript:void(0);" class="collection_t_l"></a></div>
            	 <div id="listBox">
            	<ul id="list">
                 
                </ul>
                </div>
                <div id="btnPrev"><a href="javascript:void(0);" class="collection_t_r"></a></div>
            </div>
        </div>
         <div class="clear"></div>
        <div class="btm_btn mt30">
        	<dl>
               <!-- <dd><a href="javascript:alert('开发中……');"><input type="button" class="btn" value="下一步"></a>-->
            </dl>
        </div>
    </div>
</div>

</body>
</html>